<template>
  <div id="big_box">
    <div>
      <van-cell-group>
        <van-button type="primary" class="btn_pm" to="user_info" block
          >角色属性修改</van-button
        >
        <van-button type="primary" class="btn_pm" block to="add_zb"
          >提交装备申请</van-button
        >
        <van-button type="primary" block v-if="is_login" @click="logout"
          >退出</van-button
        >
      </van-cell-group>
    </div>
    <tabbar :active_idx="4" />
  </div>
</template>

<script>
import { Cell, CellGroup, Button, Col, Row } from 'vant'
import tabbar from './tabbar.vue'
export default {
  components: {
    [Cell.name]: Cell,
    [CellGroup.name]: CellGroup,
    [Button.name]: Button,
    [Col.name]: Col,
    [Row.name]: Row,
    tabbar,
  },
  setup() {
    const is_login = localStorage.getItem('Authorization') ? true : false
    return {
      is_login,
    }
  },
  methods: {
    logout: function () {
      localStorage.removeItem('Authorization')
      this.$router.push('/login')
    },
  },
}
</script>

<style lang="scss" scoped>
#big_box {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
}
.btn_pm {
  margin: 20px 0px;
}
</style>
